"use strict"

/**
 * 宁夏省政府采购网爬虫
 *  
 */

var Base = require("./base");
var nx_spider = new Base();
nx_spider.name = "宁夏省政府采购网";

nx_spider.getPageUrl = function(pg) {
    return "http://www.ccgp-ningxia.gov.cn/public/NXGPP/dynamic/contents/CGGG/index.jsp?cid=312&sid=1&type=0&date=0&page=" + (pg - 1);
};

nx_spider.getItems = function($) {
    var items = [];
    $(".list_table a").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.ccgp-ningxia.gov.cn/public/NXGPP/dynamic/" + e.attr("href");
        console.log(item.url);
        item.source = nx_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = nx_spider;
